ScrolledWindow: Don’t req size for autohidden bars
authorDaniel Boles <dboles@src.gnome.org>
Fri, 24 Feb 2017 22:46:05 +0000 (22:46 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Wed, 10 May 2017 21:29:01 +0000 (22:29 +0100)
commita96c5864509b175d1120e467774343fad8d96769
treea787d963fed2bc15f4ee17b7c1824e680abadce8
parent1a95c259d7b37f11668f60b276100e27e2ed3c18
ScrolledWindow: Don’t req size for autohidden bars

POLICY_AUTOMATIC means scrollbars are only shown when needed, i.e. when
the size of the window is not large enough to show the entire child. So
when measuring the preferred size, such scrollbars should be ignored.

But measure() added size for *any* non-overlay scrollbar of the opposite
orientation, e.g. for horizontal size, it added the width of vscrollbar.
So we requested for child + bar, & having enough for child meant that the
policy hid the bar, leaving extra space empty below/right of the child.

Fix this by only adding size for such bars if they use POLICY_ALWAYS.

https://bugzilla.gnome.org/show_bug.cgi?id=778853
gtk/gtkscrolledwindow.c